Skip to content

Conversation

@Mscht
Copy link
Contributor

@Mscht Mscht commented Jan 20, 2025

As follow-up to #2466.
Those changes have have the same pattern.
In addition, I'm not sure about shell.cpp method PyObject_CleanupDEFCONTEXTMENU. It has two relevant calls, but I did not include any change to this one.
Please note, I just searched and edited all those methods. This pull request is not tested in some way. ;-)

Edit: Fixed PyObject_CleanupDEFCONTEXTMENU as well.

@Mscht
Copy link
Contributor Author

Mscht commented Jan 20, 2025

I pushed another commit with more occurences.
Im not sure about win32win.cpp method PyCFrameWnd_LoadBarState line 3618. The PYWINTYPES_EXCEPT contains a GUI_BLOCK_THREADS makro which may is enough.
And I don't know why clang-format has a problem.

PyWinObject_FreeWCHAR(pszAssoc);
PY_INTERFACE_POSTCALL;
PyWinObject_FreeWCHAR(pszAssoc);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I don't know why clang-format has a problem.

You have some trailing whitespaces. You can run either of these commands to fix it locally:

  • clang-format -i $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/')
  • clang-format -i com/win32comext/shell/src/PyIQueryAssociations.cpp
  • pre-commit run clang-format -a
Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the hint. I ran pre-commit. And added the fix to PyObject_CleanupDEFCONTEXTMENU as well.

@geppi
Copy link
Collaborator

geppi commented Jan 26, 2025

I'm surprised that none of the CI tests does catch any of these.

For issue #2415 the reason is that the CI pipeline does not run the COM tests.
You have to locally run the testPyComTest.py to see it fail.

What about the issue fixed with PR #2466 ?
Is that as well covered by a test not included in the CI pipeline?
Or is it not covered at all?


PyComTypeObject PyIQueryAssociations::type("PyIQueryAssociations", &PyIUnknown::type, sizeof(PyIQueryAssociations),
PyIQueryAssociations_methods, GET_PYCOM_CTOR(PyIQueryAssociations));
// This file implements the IQueryAssociations Interface and Gateway for Python.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may have accidentally changed line endings or something in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, downloading the raw File shows CRLF instead of LF of all the other files. I will try to fix it.

@geppi
Copy link
Collaborator

geppi commented Mar 1, 2025

@Mscht I think this would be an important fix. Would it be possible for you to resolve the conflicts that @Avasam pointed out, to move this PR forward?

@Mscht
Copy link
Contributor Author

Mscht commented Mar 1, 2025

Sorry, I was quiet busy the last weeks. I will take a Look into it. thank you @Avasam for the hint.

@mhammond
Copy link
Owner

mhammond commented Mar 6, 2025

For issue #2415 the reason is that the CI pipeline does not run the COM tests.
You have to locally run the testPyComTest.py to see it fail.

I think CI does run the COM tests via pywin32_testall.py. The problem is likely to be that CI simply has a very limited set of COM objects available, which probably does not include the shell - whereas running them locally typically does. If we believe COM tests aren't being run at all, then that should certainly be fixed.

Copy link
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks!

@mhammond mhammond requested a review from Avasam March 6, 2025 15:12
@Avasam
Copy link
Collaborator

Avasam commented Mar 7, 2025

I'm also concerned by the lack of CI failures on Python3.12 given the claims here and in #2466. But that's something that can be looked into separately, see if it can be improved, and tracked in a new issue.

I'm myself not fully aware what does or doesn't run on CI. I try to run relevant demos when I think about it (as shown by the shear amount of demos I've been fixing 😆). Maybe we'd need some contributor guidelines on that.

We have more and more static checkers, which helps prevent certain class of issues on the Python side, but won't replace dynamic tests.

@Avasam Avasam merged commit cfc77c6 into mhammond:main Mar 7, 2025
30 checks passed
Avasam added a commit to Avasam/pywin32 that referenced this pull request Mar 7, 2025
Avasam added a commit to Avasam/pywin32 that referenced this pull request Mar 7, 2025
Avasam added a commit to Avasam/pywin32 that referenced this pull request Mar 7, 2025
Avasam added a commit that referenced this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants